package cn.bdqn.bean;

import java.util.Date;

import cn.bdqn.listener.UserOnline;

public class User extends UserOnline {
	private Integer id        ;//userId
	private String userCode  ;//用户编号
	private String password  ;//用户密码
	private String userName  ;//用户姓名
	private Integer gender    ;//性别1：男 2：女
	private Date birthdate ;//出生日期
	private String phone     ;//联系电话
	private String address   ;//地址
	private Integer typeNo    ;//用户类型0:管理员1 经理2普通用户
	private Date createDate;//表创建日期
	private Integer createBy  ;//创建人id号
	private Date modifyDate;//修改日期
	private Integer modifyBy  ;//   修改人id号
	private Integer age  ;//   用户年龄
	private String  typeName  ;//   用户类型
	
	
	public User() {
		super();
	}


	public User( String userCode, String password, String userName,
			Integer gender, Date birthdate, String phone, String address,
			Integer typeNo) {
		super();
		this.userCode = userCode;
		this.password = password;
		this.userName = userName;
		this.gender = gender;
		this.birthdate = birthdate;
		this.phone = phone;
		this.address = address;
		this.typeNo = typeNo;
	}


	


	public Integer getId() {
		return id;
	}


	public void setId(Integer id) {
		this.id = id;
	}


	public String getUserCode() {
		return userCode;
	}


	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}


	public String getPassword() {
		return password;
	}


	public void setPassword(String password) {
		this.password = password;
	}


	public String getUserName() {
		return userName;
	}


	public void setUserName(String userName) {
		this.userName = userName;
	}


	public Integer getGender() {
		return gender;
	}


	public void setGender(Integer gender) {
		this.gender = gender;
	}


	public Date getBirthdate() {
		return birthdate;
	}


	public void setBirthdate(Date birthdate) {
		this.birthdate = birthdate;
		//计算年龄
		if(birthdate !=null){
			Date now = new Date();
			this.age = now.getYear()-birthdate.getYear();
		}
	}


	public String getPhone() {
		return phone;
	}


	public void setPhone(String phone) {
		this.phone = phone;
	}


	public String getAddress() {
		return address;
	}


	public void setAddress(String address) {
		this.address = address;
	}


	


	public Integer getTypeNo() {
		return typeNo;
	}


	public void setTypeNo(Integer typeNo) {
		this.typeNo = typeNo;
	}


	public Date getCreateDate() {
		return createDate;
	}


	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}


	public Integer getCreateBy() {
		return createBy;
	}


	public void setCreateBy(Integer createBy) {
		this.createBy = createBy;
	}


	public Date getModifyDate() {
		return modifyDate;
	}


	public void setModifyDate(Date modifyDate) {
		this.modifyDate = modifyDate;
	}


	public Integer getModifyBy() {
		return modifyBy;
	}


	public void setModifyBy(Integer modifyBy) {
		this.modifyBy = modifyBy;
	}

	

	public Integer getAge() {
		return age;
	}
	


	public String getTypeName() {
		return typeName;
	}


	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}


	@Override
	public String toString() {
		return "User [id=" + id + ", userCode=" + userCode + ", password="
				+ password + ", userName=" + userName + ", gender=" + gender
				+ ", birthdate=" + birthdate + ", phone=" + phone
				+ ", address=" + address + ", userType=" + typeNo
				+ ", createDate=" + createDate + ", createBy=" + createBy
				+ ", modifyDate=" + modifyDate + ", modifyBy=" + modifyBy
				+ ", age=" + age + "]";
	}


	
	
	
	
	
	
	

}
